package evi.com.evi.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.List;

/**
 * Created by YX_BOSS on 2017/3/15.
 */

public class GoodsManagerBean implements Parcelable {

    /**
     * code : 1
     * success : true
     * message : 操作成功！
     * data : {"merchantId":"1","stationId":"3","name":"APP调试专用","account":"test","password":"7168ff626bd734d7c2265f05d60ab83b","agreementNo":"15645454788","agreementStartTime":"2017-03-01","agreementEndTime":"2017-03-31","linkman":"APP调试专用","phoneNo":"15645454788","email":null,"address":"aaaaa","imageId":"40283c955acb8a70015acb8b88aa0000","imageUrl":null,"introduction":null,"serviceTypeId":"service_type_catering_trade","announcement":"今天天气不错","evaluate":3,"status":null,"sailsInMonth":null,"startTime":80000,"stopTime":220000,"createDate":"2017-03-03","categories":[{"products":[{"productId":"4","merchantId":"1","stationId":null,"categorytId":null,"stationName":null,"seriesNo":null,"name":"香她他","price":18,"imageId":"40283cd55a9d2474015a9d24d2b000a8","imageUrl":"/images/default.jpg","logoImageUrl":null,"unit":"份","stock":1,"state":1,"note":null,"introduction":"香辣排骨","score":1,"hits":1,"sales":1,"sorter":null,"recommend":10000,"createDate":"2017-03-03"}],"productCategoryId":"3","merchantId":"1","name":"煲仔饭","category":"煲仔饭","sorter":1},{"products":[{"productId":"7","merchantId":"1","stationId":null,"categorytId":null,"stationName":null,"seriesNo":null,"name":"可乐","price":null,"imageId":"40283cd55a9d2474015a9d24d2b000a8","imageUrl":"/images/default.jpg","logoImageUrl":null,"unit":"瓶","stock":1,"state":1,"note":null,"introduction":"可乐","score":1,"hits":1,"sales":1,"sorter":null,"recommend":10002,"createDate":"2017-03-03"},{"productId":"4","merchantId":"1","stationId":null,"categorytId":null,"stationName":null,"seriesNo":null,"name":"香她他","price":18,"imageId":"40283cd55a9d2474015a9d24d2b000a8","imageUrl":"/images/default.jpg","logoImageUrl":null,"unit":"份","stock":1,"state":1,"note":null,"introduction":"香辣排骨","score":1,"hits":1,"sales":1,"sorter":null,"recommend":10000,"createDate":"2017-03-03"}],"productCategoryId":"4","merchantId":"1","name":"饮料","category":"康师傅","sorter":2},{"products":[],"productCategoryId":"40283c8a5ad0c75e015ad0c7e1ed0000","merchantId":"1","name":"水果","category":null,"sorter":3},{"products":[],"productCategoryId":"40283c8a5ad0c75e015ad0db4fd10001","merchantId":"1","name":"炒菜","category":null,"sorter":4},{"products":[],"productCategoryId":"40283c8a5ad0c75e015ad0e5f4230002","merchantId":"1","name":"炖菜","category":null,"sorter":5}]}
     */

    private int code;
    private boolean success;
    private String message;
    private DataBean data;

    @Override
    public String toString() {
        return "GoodsManagerBean{" +
                "code=" + code +
                ", success=" + success +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }

    public GoodsManagerBean() {

    }

    protected GoodsManagerBean(Parcel in) {
        code = in.readInt();
        success = in.readByte() != 0;
        message = in.readString();
        data = in.readParcelable(DataBean.class.getClassLoader());
    }

    public static final Creator<GoodsManagerBean> CREATOR = new Creator<GoodsManagerBean>() {
        @Override
        public GoodsManagerBean createFromParcel(Parcel in) {
            return new GoodsManagerBean(in);
        }

        @Override
        public GoodsManagerBean[] newArray(int size) {
            return new GoodsManagerBean[size];
        }
    };

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(code);
        dest.writeByte((byte) (success ? 1 : 0));
        dest.writeString(message);
    }

    public static class DataBean implements Parcelable {
        /**
         * merchantId : 1
         * stationId : 3
         * name : APP调试专用
         * account : test
         * password : 7168ff626bd734d7c2265f05d60ab83b
         * agreementNo : 15645454788
         * agreementStartTime : 2017-03-01
         * agreementEndTime : 2017-03-31
         * linkman : APP调试专用
         * phoneNo : 15645454788
         * email : null
         * address : aaaaa
         * imageId : 40283c955acb8a70015acb8b88aa0000
         * imageUrl : null
         * introduction : null
         * serviceTypeId : service_type_catering_trade
         * announcement : 今天天气不错
         * evaluate : 3.0
         * status : null
         * sailsInMonth : null
         * startTime : 80000
         * stopTime : 220000
         * createDate : 2017-03-03
         * categories : [{"products":[{"productId":"4","merchantId":"1","stationId":null,"categorytId":null,"stationName":null,"seriesNo":null,"name":"香她他","price":18,"imageId":"40283cd55a9d2474015a9d24d2b000a8","imageUrl":"/images/default.jpg","logoImageUrl":null,"unit":"份","stock":1,"state":1,"note":null,"introduction":"香辣排骨","score":1,"hits":1,"sales":1,"sorter":null,"recommend":10000,"createDate":"2017-03-03"}],"productCategoryId":"3","merchantId":"1","name":"煲仔饭","category":"煲仔饭","sorter":1},{"products":[{"productId":"7","merchantId":"1","stationId":null,"categorytId":null,"stationName":null,"seriesNo":null,"name":"可乐","price":null,"imageId":"40283cd55a9d2474015a9d24d2b000a8","imageUrl":"/images/default.jpg","logoImageUrl":null,"unit":"瓶","stock":1,"state":1,"note":null,"introduction":"可乐","score":1,"hits":1,"sales":1,"sorter":null,"recommend":10002,"createDate":"2017-03-03"},{"productId":"4","merchantId":"1","stationId":null,"categorytId":null,"stationName":null,"seriesNo":null,"name":"香她他","price":18,"imageId":"40283cd55a9d2474015a9d24d2b000a8","imageUrl":"/images/default.jpg","logoImageUrl":null,"unit":"份","stock":1,"state":1,"note":null,"introduction":"香辣排骨","score":1,"hits":1,"sales":1,"sorter":null,"recommend":10000,"createDate":"2017-03-03"}],"productCategoryId":"4","merchantId":"1","name":"饮料","category":"康师傅","sorter":2},{"products":[],"productCategoryId":"40283c8a5ad0c75e015ad0c7e1ed0000","merchantId":"1","name":"水果","category":null,"sorter":3},{"products":[],"productCategoryId":"40283c8a5ad0c75e015ad0db4fd10001","merchantId":"1","name":"炒菜","category":null,"sorter":4},{"products":[],"productCategoryId":"40283c8a5ad0c75e015ad0e5f4230002","merchantId":"1","name":"炖菜","category":null,"sorter":5}]
         */

        private String merchantId;
        private String stationId;
        private String name;
        private String account;
        private String password;
        private String agreementNo;
        private String agreementStartTime;
        private String agreementEndTime;
        private String linkman;
        private String phoneNo;
        private Object email;
        private String address;
        private String imageId;
        private Object imageUrl;
        private Object introduction;
        private String serviceTypeId;
        private String announcement;
        private double evaluate;
        private Object status;
        private Object sailsInMonth;
        private int startTime;
        private int stopTime;
        private String createDate;
        private List<CategoriesBean> categories;

        @Override
        public String toString() {
            return "DataBean{" +
                    "merchantId='" + merchantId + '\'' +
                    ", stationId='" + stationId + '\'' +
                    ", name='" + name + '\'' +
                    ", account='" + account + '\'' +
                    ", password='" + password + '\'' +
                    ", agreementNo='" + agreementNo + '\'' +
                    ", agreementStartTime='" + agreementStartTime + '\'' +
                    ", agreementEndTime='" + agreementEndTime + '\'' +
                    ", linkman='" + linkman + '\'' +
                    ", phoneNo='" + phoneNo + '\'' +
                    ", email=" + email +
                    ", address='" + address + '\'' +
                    ", imageId='" + imageId + '\'' +
                    ", imageUrl=" + imageUrl +
                    ", introduction=" + introduction +
                    ", serviceTypeId='" + serviceTypeId + '\'' +
                    ", announcement='" + announcement + '\'' +
                    ", evaluate=" + evaluate +
                    ", status=" + status +
                    ", sailsInMonth=" + sailsInMonth +
                    ", startTime=" + startTime +
                    ", stopTime=" + stopTime +
                    ", createDate='" + createDate + '\'' +
                    ", categories=" + categories +
                    '}';
        }

        protected DataBean() {

        }

        protected DataBean(Parcel in) {
            merchantId = in.readString();
            stationId = in.readString();
            name = in.readString();
            account = in.readString();
            password = in.readString();
            agreementNo = in.readString();
            agreementStartTime = in.readString();
            agreementEndTime = in.readString();
            linkman = in.readString();
            phoneNo = in.readString();
            address = in.readString();
            imageId = in.readString();
            serviceTypeId = in.readString();
            announcement = in.readString();
            evaluate = in.readDouble();
            startTime = in.readInt();
            stopTime = in.readInt();
            createDate = in.readString();
            categories = in.readParcelable(CategoriesBean.class.getClassLoader());
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel in) {
                return new DataBean(in);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };

        public String getMerchantId() {
            return merchantId;
        }

        public void setMerchantId(String merchantId) {
            this.merchantId = merchantId;
        }

        public String getStationId() {
            return stationId;
        }

        public void setStationId(String stationId) {
            this.stationId = stationId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAccount() {
            return account;
        }

        public void setAccount(String account) {
            this.account = account;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getAgreementNo() {
            return agreementNo;
        }

        public void setAgreementNo(String agreementNo) {
            this.agreementNo = agreementNo;
        }

        public String getAgreementStartTime() {
            return agreementStartTime;
        }

        public void setAgreementStartTime(String agreementStartTime) {
            this.agreementStartTime = agreementStartTime;
        }

        public String getAgreementEndTime() {
            return agreementEndTime;
        }

        public void setAgreementEndTime(String agreementEndTime) {
            this.agreementEndTime = agreementEndTime;
        }

        public String getLinkman() {
            return linkman;
        }

        public void setLinkman(String linkman) {
            this.linkman = linkman;
        }

        public String getPhoneNo() {
            return phoneNo;
        }

        public void setPhoneNo(String phoneNo) {
            this.phoneNo = phoneNo;
        }

        public Object getEmail() {
            return email;
        }

        public void setEmail(Object email) {
            this.email = email;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getImageId() {
            return imageId;
        }

        public void setImageId(String imageId) {
            this.imageId = imageId;
        }

        public Object getImageUrl() {
            return imageUrl;
        }

        public void setImageUrl(Object imageUrl) {
            this.imageUrl = imageUrl;
        }

        public Object getIntroduction() {
            return introduction;
        }

        public void setIntroduction(Object introduction) {
            this.introduction = introduction;
        }

        public String getServiceTypeId() {
            return serviceTypeId;
        }

        public void setServiceTypeId(String serviceTypeId) {
            this.serviceTypeId = serviceTypeId;
        }

        public String getAnnouncement() {
            return announcement;
        }

        public void setAnnouncement(String announcement) {
            this.announcement = announcement;
        }

        public double getEvaluate() {
            return evaluate;
        }

        public void setEvaluate(double evaluate) {
            this.evaluate = evaluate;
        }

        public Object getStatus() {
            return status;
        }

        public void setStatus(Object status) {
            this.status = status;
        }

        public Object getSailsInMonth() {
            return sailsInMonth;
        }

        public void setSailsInMonth(Object sailsInMonth) {
            this.sailsInMonth = sailsInMonth;
        }

        public int getStartTime() {
            return startTime;
        }

        public void setStartTime(int startTime) {
            this.startTime = startTime;
        }

        public int getStopTime() {
            return stopTime;
        }

        public void setStopTime(int stopTime) {
            this.stopTime = stopTime;
        }

        public String getCreateDate() {
            return createDate;
        }

        public void setCreateDate(String createDate) {
            this.createDate = createDate;
        }

        public List<CategoriesBean> getCategories() {
            return categories;
        }

        public void setCategories(List<CategoriesBean> categories) {
            this.categories = categories;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(merchantId);
            dest.writeString(stationId);
            dest.writeString(name);
            dest.writeString(account);
            dest.writeString(password);
            dest.writeString(agreementNo);
            dest.writeString(agreementStartTime);
            dest.writeString(agreementEndTime);
            dest.writeString(linkman);
            dest.writeString(phoneNo);
            dest.writeString(address);
            dest.writeString(imageId);
            dest.writeString(serviceTypeId);
            dest.writeString(announcement);
            dest.writeDouble(evaluate);
            dest.writeInt(startTime);
            dest.writeInt(stopTime);
            dest.writeString(createDate);
        }

        public static class CategoriesBean implements Parcelable {
            /**
             * products : [{"productId":"4","merchantId":"1","stationId":null,"categorytId":null,"stationName":null,"seriesNo":null,"name":"香她他","price":18,"imageId":"40283cd55a9d2474015a9d24d2b000a8","imageUrl":"/images/default.jpg","logoImageUrl":null,"unit":"份","stock":1,"state":1,"note":null,"introduction":"香辣排骨","score":1,"hits":1,"sales":1,"sorter":null,"recommend":10000,"createDate":"2017-03-03"}]
             * productCategoryId : 3
             * merchantId : 1
             * name : 煲仔饭
             * category : 煲仔饭
             * sorter : 1
             */

            private String productCategoryId;
            private String merchantId;
            private String name;
            private String category;
            private int sorter;
            private List<ProductsBean> products;

            @Override
            public String toString() {
                return "CategoriesBean{" +
                        "productCategoryId='" + productCategoryId + '\'' +
                        ", merchantId='" + merchantId + '\'' +
                        ", name='" + name + '\'' +
                        ", category='" + category + '\'' +
                        ", sorter=" + sorter +
                        ", products=" + products +
                        '}';
            }

            protected CategoriesBean() {

            }

            protected CategoriesBean(Parcel in) {
                productCategoryId = in.readString();
                merchantId = in.readString();
                name = in.readString();
                category = in.readString();
                sorter = in.readInt();
                products = in.readParcelable(ProductsBean.class.getClassLoader());
            }

            public static final Creator<CategoriesBean> CREATOR = new Creator<CategoriesBean>() {
                @Override
                public CategoriesBean createFromParcel(Parcel in) {
                    return new CategoriesBean(in);
                }

                @Override
                public CategoriesBean[] newArray(int size) {
                    return new CategoriesBean[size];
                }
            };

            public String getProductCategoryId() {
                return productCategoryId;
            }

            public void setProductCategoryId(String productCategoryId) {
                this.productCategoryId = productCategoryId;
            }

            public String getMerchantId() {
                return merchantId;
            }

            public void setMerchantId(String merchantId) {
                this.merchantId = merchantId;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getCategory() {
                return category;
            }

            public void setCategory(String category) {
                this.category = category;
            }

            public int getSorter() {
                return sorter;
            }

            public void setSorter(int sorter) {
                this.sorter = sorter;
            }

            public List<ProductsBean> getProducts() {
                return products;
            }

            public void setProducts(List<ProductsBean> products) {
                this.products = products;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(productCategoryId);
                dest.writeString(merchantId);
                dest.writeString(name);
                dest.writeString(category);
                dest.writeInt(sorter);
            }

            public static class ProductsBean implements Parcelable {
                /**
                 * productId : 4
                 * merchantId : 1
                 * stationId : null
                 * categorytId : null
                 * stationName : null
                 * seriesNo : null
                 * name : 香她他
                 * price : 18.0
                 * imageId : 40283cd55a9d2474015a9d24d2b000a8
                 * imageUrl : /images/default.jpg
                 * logoImageUrl : null
                 * unit : 份
                 * stock : 1
                 * state : 1
                 * note : null
                 * introduction : 香辣排骨
                 * score : 1
                 * hits : 1
                 * sales : 1
                 * sorter : null
                 * recommend : 10000
                 * createDate : 2017-03-03
                 */

                private String productId;
                private String merchantId;
                private Object stationId;
                private Object categorytId;
                private Object stationName;
                private Object seriesNo;
                private String name;
                private double price;
                private String imageId;
                private String imageUrl;
                private Object logoImageUrl;
                private String unit;
                private int stock;
                private int state;
                private Object note;
                private String introduction;
                private int score;
                private int hits;
                private int sales;
                private Object sorter;
                private int recommend;
                private String createDate;

                @Override
                public String toString() {
                    return "ProductsBean{" +
                            "productId='" + productId + '\'' +
                            ", merchantId='" + merchantId + '\'' +
                            ", stationId=" + stationId +
                            ", categorytId=" + categorytId +
                            ", stationName=" + stationName +
                            ", seriesNo=" + seriesNo +
                            ", name='" + name + '\'' +
                            ", price=" + price +
                            ", imageId='" + imageId + '\'' +
                            ", imageUrl='" + imageUrl + '\'' +
                            ", logoImageUrl=" + logoImageUrl +
                            ", unit='" + unit + '\'' +
                            ", stock=" + stock +
                            ", state=" + state +
                            ", note=" + note +
                            ", introduction='" + introduction + '\'' +
                            ", score=" + score +
                            ", hits=" + hits +
                            ", sales=" + sales +
                            ", sorter=" + sorter +
                            ", recommend=" + recommend +
                            ", createDate='" + createDate + '\'' +
                            '}';
                }

                protected ProductsBean() {

                }

                protected ProductsBean(Parcel in) {
                    productId = in.readString();
                    merchantId = in.readString();
                    name = in.readString();
                    price = in.readDouble();
                    imageId = in.readString();
                    imageUrl = in.readString();
                    unit = in.readString();
                    stock = in.readInt();
                    state = in.readInt();
                    introduction = in.readString();
                    score = in.readInt();
                    hits = in.readInt();
                    sales = in.readInt();
                    recommend = in.readInt();
                    createDate = in.readString();
                }

                public static final Creator<ProductsBean> CREATOR = new Creator<ProductsBean>() {
                    @Override
                    public ProductsBean createFromParcel(Parcel in) {
                        return new ProductsBean(in);
                    }

                    @Override
                    public ProductsBean[] newArray(int size) {
                        return new ProductsBean[size];
                    }
                };

                public String getProductId() {
                    return productId;
                }

                public void setProductId(String productId) {
                    this.productId = productId;
                }

                public String getMerchantId() {
                    return merchantId;
                }

                public void setMerchantId(String merchantId) {
                    this.merchantId = merchantId;
                }

                public Object getStationId() {
                    return stationId;
                }

                public void setStationId(Object stationId) {
                    this.stationId = stationId;
                }

                public Object getCategorytId() {
                    return categorytId;
                }

                public void setCategorytId(Object categorytId) {
                    this.categorytId = categorytId;
                }

                public Object getStationName() {
                    return stationName;
                }

                public void setStationName(Object stationName) {
                    this.stationName = stationName;
                }

                public Object getSeriesNo() {
                    return seriesNo;
                }

                public void setSeriesNo(Object seriesNo) {
                    this.seriesNo = seriesNo;
                }

                public String getName() {
                    return name;
                }

                public void setName(String name) {
                    this.name = name;
                }

                public double getPrice() {
                    return price;
                }

                public void setPrice(double price) {
                    this.price = price;
                }

                public String getImageId() {
                    return imageId;
                }

                public void setImageId(String imageId) {
                    this.imageId = imageId;
                }

                public String getImageUrl() {
                    return imageUrl;
                }

                public void setImageUrl(String imageUrl) {
                    this.imageUrl = imageUrl;
                }

                public Object getLogoImageUrl() {
                    return logoImageUrl;
                }

                public void setLogoImageUrl(Object logoImageUrl) {
                    this.logoImageUrl = logoImageUrl;
                }

                public String getUnit() {
                    return unit;
                }

                public void setUnit(String unit) {
                    this.unit = unit;
                }

                public int getStock() {
                    return stock;
                }

                public void setStock(int stock) {
                    this.stock = stock;
                }

                public int getState() {
                    return state;
                }

                public void setState(int state) {
                    this.state = state;
                }

                public Object getNote() {
                    return note;
                }

                public void setNote(Object note) {
                    this.note = note;
                }

                public String getIntroduction() {
                    return introduction;
                }

                public void setIntroduction(String introduction) {
                    this.introduction = introduction;
                }

                public int getScore() {
                    return score;
                }

                public void setScore(int score) {
                    this.score = score;
                }

                public int getHits() {
                    return hits;
                }

                public void setHits(int hits) {
                    this.hits = hits;
                }

                public int getSales() {
                    return sales;
                }

                public void setSales(int sales) {
                    this.sales = sales;
                }

                public Object getSorter() {
                    return sorter;
                }

                public void setSorter(Object sorter) {
                    this.sorter = sorter;
                }

                public int getRecommend() {
                    return recommend;
                }

                public void setRecommend(int recommend) {
                    this.recommend = recommend;
                }

                public String getCreateDate() {
                    return createDate;
                }

                public void setCreateDate(String createDate) {
                    this.createDate = createDate;
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeString(productId);
                    dest.writeString(merchantId);
                    dest.writeString(name);
                    dest.writeDouble(price);
                    dest.writeString(imageId);
                    dest.writeString(imageUrl);
                    dest.writeString(unit);
                    dest.writeInt(stock);
                    dest.writeInt(state);
                    dest.writeString(introduction);
                    dest.writeInt(score);
                    dest.writeInt(hits);
                    dest.writeInt(sales);
                    dest.writeInt(recommend);
                    dest.writeString(createDate);
                }
            }
        }
    }
}
